@extends('layouts.information')

@section('title','修改')

@section('content')
    <div class="row">
        <div class="col-md-9">
            {!! Form::model($company,['files'=>true]) !!}
            <div class="form-group">
                {!! Form::label('name') !!}
                {!! Form::password('name',['class'=>'form-control',]) !!}
            </div>
            <div class="form-group">
                {!! Form::label('province') !!}
                {!! Form::select('province') !!}
            </div>
            <div class="form-group">
                {!! Form::label('city') !!}
                {!! Form::select('city') !!}
            </div>
            <div class="form-group">
                {!! Form::label('county') !!}
                {!! Form::select('county') !!}
            </div>
            <div class="form-group">
                {!! Form::label('address') !!}
                {!! Form::text('address',null,['class'=>'form-control']) !!}
            </div>
            <div class="form-group">
                {!! Form::label('phone') !!}
                {!! Form::text('phone',null,['class'=>'form-control']) !!}
            </div>
            <div class="form-group">
                {!! Form::label('file') !!}
                {!! Form::file('file',['class'=>'form-control']) !!}
            </div>
            <div class="form-group">
                <img src="{{ asset('storage/'.$company->license_business_pic) }}" width="300" height="200"/>
            </div>
            <div class="form-group">
                {!! Form::label('size') !!}
                {!! Form::text('size',null,['class'=>'form-control']) !!}
            </div>
            <div class="form-group">
                {!! Form::label('vocation') !!}
                {!! Form::text('vocation',null,['class'=>'form-control']) !!}
            </div>
            {!! Form::submit('修改') !!}
            {!! Form::close() !!}
            <ul>
                <li>
                    <a href="{{ route('company.show') }}">返回</a>
                </li>
            </ul>
        </div>
    </div>
@endsection

@section('scripts')
    <script src="{{ asset('assets/js/area.js') }}"></script>
    <script>
        s = ['province', 'city', 'county'];
        _init_area();
        $("#province").val("{{ $company->province }}");
        change(1);
        $("#city").val("{{ $company->city }}");
        change(2);
        $("#county").val("{{ $company->county }}");
    </script>
    @if ($errors->any())
        <script>
            alert('{{ current($errors->all()) }}');
        </script>
    @endif
@endsection